//2. 创建组件
//3. 定义路由
import about from "../components/about"
import home from "../components/home"
import news from "../components/news"
import message from "../components/message"
import user from "../components/user"
import userDetail from "../components/userDetail"
const routes = [
  {path:"/about",component:about},
  {
    path:"/home",
    component:home,
    // 嵌套路由
    children:[
      {path:"news",component:news},
      {path:"message",component:message},
      {path:"",redirect:"news"},
    ]
  },
  {
    path:"/user",
    component:user,
    children:[
      {path:":id",component:userDetail},
      {path:"",redirect:"1"}
    ]
  },
  {path:"/",redirect:"/about"}
]

export default routes

// {path:"/user/:id",component:user}
